# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Number-Fraction.t'

#########################

# change 'tests => 1' to 'tests => last_test_to_print';

use Test::More tests => 17;
use Test::Fatal;
BEGIN { use_ok('Number::Fraction') };

#########################

# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.

my $y = Number::Fraction->new(num => 8, den => 5);
isa_ok( $y, 'Number::Fraction' );
isa_ok( $y, 'Moose::Object' );
is( $y->num, 8, '... got the right value (8) for num' );
is( $y->den, 5, '... got the right value (5) for den' );

my $x = Number::Fraction->new('7/0');
isa_ok( $x, 'Number::Fraction' );
isa_ok( $x, 'Moose::Object' );
is( $x->num, 7, '... got the right value (7) for num' );
is( $x->den, 0, '... got the right value (0) for den' );

my $w = Number::Fraction->new(4, 5);
isa_ok( $w, 'Number::Fraction' );
isa_ok( $w, 'Moose::Object' );
is( $w->num, 4, '... got the right value (4) for num' );
is( $w->den, 5, '... got the right value (5) for den' );


my $k = $y->new();

isa_ok( $k, 'Number::Fraction' );
isa_ok( $k, 'Moose::Object' );

is( $k->num, 0, '... got the right value (0) for num' );
is( $k->den, 1, '... got the right value (1) for den' );